package main

import (
	"sync"
	"time"
)

/* 延迟排序算法 */
func main() {
	arr := [...]int{67, 213, 12, 23, 1, 3, 221, 21, 22}
	wg := sync.WaitGroup{}
	for _, v := range arr {
		wg.Add(1)
		go func(value int) {
			time.Sleep(time.Duration(value) * time.Millisecond * 10)
			println(value)
			wg.Done()
		}(v)
	}
	wg.Wait()
}
